﻿//--------------------------------------------------------------------------
// 
//  Copyright (c) Chili Software.  All rights reserved. 
// 
//  File: PersistRelationships.cs
//
//  Description: Specifies the persisting order in a relation.
// 
//--------------------------------------------------------------------------

using System;

namespace Chili.Opf3.Relations
{
	/// <summary>
	/// Specifies the relationship the child objects and its parent object. It specifies which one
	/// is saved first.
	/// </summary>
	/// <remarks>
	/// PersistRelationship specifies the relationship the child objects and its parent object. 
	/// This enumeration is only used in the <see cref="Opf3.Relations.RelationAttribute">RelationAttribute</see> 
	/// to specify the direction of the relation in 1:1 relations. For 1:n it is not required to use 
	/// this enumeration.
	/// </remarks>
	[Serializable]
	public enum PersistRelationships
	{
		/// <summary>
		/// Applying this member means that the child object holds a foreign key to the owner object.
		/// </summary>
		ParentFirst, // Old name: FromChild
		/// <summary>
		/// Applying this member means the owner object holds a foreign key to the child object.
		/// </summary>
		ChildFirst   // Old name: ToChild
	}
}
